package com.kexio.security.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 登录请求DTO
 * 
 * @author Kexio Team
 * @since 1.0.0
 */
@Data
@Schema(description = "登录请求DTO")
public class LoginRequest {

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 100, message = "用户名长度必须在3-100之间")
    @Schema(description = "用户名", example = "admin")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 32, message = "密码长度必须在6-32之间")
    @Schema(description = "密码", example = "password123")
    private String password;

    /**
     * 验证码
     */
    @Schema(description = "验证码", example = "A3B8")
    private String captcha;

    // ==================== 手写Getter方法 ====================
    public String getUsername() { return username; }
    public String getPassword() { return password; }
    public Boolean getRememberMe() { return rememberMe; }
    public String getCaptcha() { return captcha; }

    // ==================== 手写Setter方法 ====================
    public void setUsername(String username) { this.username = username; }
    public void setPassword(String password) { this.password = password; }
    public void setRememberMe(Boolean rememberMe) { this.rememberMe = rememberMe; }
    public void setCaptcha(String captcha) { this.captcha = captcha; }

    /**
     * 验证码键值
     */
    @Schema(description = "验证码键值", example = "captcha_key_12345")
    private String captchaKey;

    /**
     * 设备类型
     */
    @Schema(description = "设备类型", example = "web")
    private String deviceType = "web";

    /**
     * 是否记住登录状态
     */
    @Schema(description = "是否记住登录状态", example = "false")
    private Boolean rememberMe = false;

}